/**
 * Created by Administrator on 2022/8/21.
 */
class Animal {
    public String name = "阿黄";
    public int age;

    public void eat() {
        System.out.println(name+"吃饭饭");
    }
}
//如果访问的成员变量子类中有，优先访问自己的成员变量
class Dog extends Animal {
    public String name = "多多";
    public void call() {
        System.out.println(name+"汪汪");
    }
}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.call();
    }

}
